<template>
  <a-drawer
    :width="900"
    closable
    placement="right"
    :visible="visible"
    @close="visible=false"
  >
    <div slot="title" class="g-flex g-y-center">
      <div style="color: #000000;font-weight: bold;">项目详情</div>
      <div style="font-size: 12px;margin-left: 30px;color: #333333;">姓名：{{row_record.name}}</div>
      <div style="font-size: 12px;margin-left: 20px;color: #333333;">卡号：{{row_record.card_no}}</div>
    </div>
    <!--子表格-->
    <a-table
      :scroll="{x:800}"
      :columns="innerColumns"
      :data-source="row_record.consultItems"
      :rowKey="(record,index)=> index"
    >
      <!--序号-->
      <template slot="index" slot-scope="text,record,index">
        <span>{{index+1}}</span>
      </template>
    </a-table>
  </a-drawer>
</template>

<script>

export default {
  data () {
    return {
      row_record:{},
      visible:false,
      form: this.$form.createForm(this),
      innerColumns: [
        { title: '序号', scopedSlots: { customRender: 'index' },width:60,fixed:'left' },
        { title: '科室', dataIndex: 'deptName',width: 80, ellipsis: true },
        { title: '项目名称', dataIndex: 'itemName', width: 120, ellipsis: true},
        { title: '数量', dataIndex: 'qty', width: 80,ellipsis: true },
        { title: '价格', dataIndex: 'itemPrice',width: 80, ellipsis: true },
        { title: '折扣', dataIndex: 'discount', width: 80, ellipsis: true },
        { title: '报价', dataIndex: 'chargeAmt', width: 80,ellipsis: true },
        { title: '状态', dataIndex: 'charge_state', width: 100, ellipsis: true },
      ],
    }
  },
  methods: {
    show (row_record) {
      this.row_record=row_record
      this.visible = true
      this.form.resetFields()
    },
  }
}
</script>

<style lang="less" scoped>

</style>

